package com.tb.education.common.packets;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

/**
 * @author wangze
 * @date 2020-07-08 16:05.
 **/
public class Head {
	public static  final  String  SEPARATOR=",";
	private String deviceNo;

	private String iccId;

	private String serialNo;

	/**
	 * 接口类型
	 */
	private String operationType;

	/**
	 * 报文类型
	 */
	private Integer packetType;

	/**
	 * 时间
	 */
	private LocalDateTime time;

	/**
	 * 报文体长度
	 */
	private Integer packetLength;


	public String getDeviceNo() {
		return deviceNo;
	}

	public void setDeviceNo(String deviceNo) {
		this.deviceNo = deviceNo;
	}

	public String getIccId() {
		return iccId;
	}

	public void setIccId(String iccId) {
		this.iccId = iccId;
	}

	public String getSerialNo() {
		return serialNo;
	}

	public void setSerialNo(String serialNo) {
		this.serialNo = serialNo;
	}

	public String getOperationType() {
		return operationType;
	}

	public void setOperationType(String operationType) {
		this.operationType = operationType;
	}

	public Integer getPacketType() {
		return packetType;
	}

	public void setPacketType(Integer packetType) {
		this.packetType = packetType;
	}

	public LocalDateTime getTime() {
		return time;
	}

	public void setTime(LocalDateTime time) {
		this.time = time;
	}

	public Integer getPacketLength() {
		return packetLength;
	}

	public void setPacketLength(Integer packetLength) {
		this.packetLength = packetLength;
	}

	@Override
	public  String toString(){
		DateTimeFormatter format = DateTimeFormatter.ofPattern("yyyyMMddHHmmss");
		return  String.join(Head.SEPARATOR,
				deviceNo,iccId,
				serialNo,
				operationType,
				packetType.toString(),
				format.format(time),packetLength.toString());
	}


//	public  static  Head getHead(){
//		Head head=new Head()
//	}


}
